﻿using System;
using System.Linq;
namespace ConsoleApp_d2
{
    class Program
    {
        static void Main(string[] args)
        {
            int line=0;
            int[] arr = new int[100];
            Random rd = new Random();
            for(int i = 0; i < 100; i++)
            {
                arr[i] = rd.Next(1001);
            }
            var m = from n in arr orderby n descending select n;
            double avg =m.Average();
            int sum=m.Sum();
            foreach(var n in m)
            {
                if (line == 10) {
                    Console.WriteLine();
                    line = 0;
                }
                Console.Write(n+" ");
                line++;
            }
            Console.WriteLine();
            Console.WriteLine("总和为："+sum);
            Console.WriteLine("平均数为："+avg);
        }
    }
}
